//
//  JoinedTribeBlock.m
//  yigou
//
//  Created by SunChao on 17/1/11.
//  Copyright © 2017年 hanyiwang. All rights reserved.
//

#import "JoinedTribeBlock.h"

#define imgWidth 128
#define imgHeight 85
#define imgSpace 7

@implementation JoinedTribeBlock

- (id)init{
    self = [super init];
    if(self)
    {
        
        self.backgroundColor = [UIColor whiteColor];
        self.img = [UIImageView new];
        self.img.frame = CGRectMake(0, 0, imgWidth, imgHeight);
        self.img.layer.cornerRadius = 8;
        self.img.layer.masksToBounds = YES;
        [self addSubview:_img];
        UIImageView *coverImg = [[UIImageView alloc]initWithFrame:self.img.frame];
        [_img addSubview:coverImg];
        UIView *view = [[UIView alloc]initWithFrame:self.img.frame];
        view.backgroundColor = [UIColor blackColor];
        view.alpha = 0.3;
        view.layer.cornerRadius = 8;
        view.layer.masksToBounds = YES;
        [self addSubview:view];
        self.title = [UILabel new];
        [self addSubview:_title];
        [_title setFont:[UIFont fontWithName:@"Helvetica-Bold" size:14]];
        _title.textColor = [UIColor whiteColor];
        _title.textAlignment = NSTextAlignmentCenter;
        [_title mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(imgWidth, 20));
            make.center.equalTo(self.img);
        }];
    }
    return self;
}

@end
